TIKA-4703: Fix tika-grpc Docker image missing runtime dependencies - #2790
Merged
Conversation
nddipiazza
force-pushed
the
TIKA-4703-fix-grpc-missing-lib-deps
branch
from
April 27, 2026 13:52
799b436 to
bf22314
Compare
Use 'mvn dependency:copy-dependencies' to populate the lib/ directory of runtime jars that the MANIFEST.MF Class-Path entries reference. Without this the image only contained the thin jar and Java threw: NoClassDefFoundError: io/grpc/BindableService The jar's MANIFEST.MF (set by maven-jar-plugin classpathPrefix=lib/) expects dependencies at lib/ relative to the jar, i.e. /tika/libs/lib/ in the image. Running dependency:copy-dependencies into that path after the main build ensures all runtime deps are present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nddipiazza
force-pushed
the
TIKA-4703-fix-grpc-missing-lib-deps
branch
from
April 27, 2026 13:54
bf22314 to
8b6dd80
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the tika-grpc Docker image startup failure caused by missing runtime dependency jars referenced via MANIFEST.MF Class-Path, by ensuring the Docker build context includes both the thin jar and its lib/ directory as produced by the Maven assembly zip.
Changes:
- Update the snapshot Docker workflow to unzip the
tika-grpcassembly zip and copy bothtika-grpc-*.jarandlib/*.jarinto the image build context. - Update the release Docker workflow to do the same for tagged releases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/docker-snapshot.yml | Switches tika-grpc build context packaging from copying only the jar to extracting jar + lib/ from the assembly zip. |
| .github/workflows/docker-release.yml | Applies the same assembly-zip extraction approach for release builds to ensure runtime deps are present in the image. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…c smoke test - Rename classpathPrefix from lib/ to tika-grpc/ in maven-jar-plugin so MANIFEST.MF Class-Path matches the actual directory layout in the image - Update docker-snapshot.yml and docker-release.yml: rename libs/lib -> libs/tika-grpc, consolidate separate 'Collect' + 'Prepare' steps into a single Prepare step - Add smoke test to docker-snapshot.yml: builds single-arch image with --load, starts container, polls for 'Server started' log line, fails CI if not seen within 30s Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ages - Build single-arch (amd64) image with --load before each multi-arch push - Poll for 'Started Apache Tika server' log line for up to 40 seconds - Fail CI job if server does not start; dump logs on failure - tika-server has no missing-deps issue (bin.tgz already bundles lib/) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bartek
approved these changes
Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ke tests - Update assembly.xml outputDirectory from lib/ to tika-grpc/ to match classpathPrefix in pom.xml; without this the binary zip would have deps under lib/ while MANIFEST.MF Class-Path references tika-grpc/*.jar - Replace bare docker stop/exit in all three smoke test steps with a trap cleanup function using docker rm -f; this prevents bash -e from failing on a stop of an already-exited container and ensures logs are always collected on failure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
tika-grpcDocker image was failing to start with:Root Cause
The Docker build context only copied the thin jar (
tika-grpc-X.jar) but not its runtime dependencies. The jar'sMANIFEST.MFhasClass-Path: tika-grpc/grpc-stub-X.jar tika-grpc/grpc-netty-shaded-X.jar ...(set byclasspathPrefixinmaven-jar-plugin), so Java looks for deps relative to the jar — and they were not present in the image.Changes
tika-grpc/pom.xml: ChangedclasspathPrefixfromlib/totika-grpc/so theMANIFEST.MFClass-Path entries match the actual directory layout in the imagedocker-snapshot.yml/docker-release.yml: Usemvn dependency:copy-dependenciesto collect runtime deps intolibs/tika-grpc/alongside the main jar; consolidate into a single Prepare step--load, starts the container, and polls for the startup log line before the final multi-arch push — CI fails if the server doesn't start within the timeoutFinal image layout
Critical Files
tika-grpc/pom.xml.github/workflows/docker-snapshot.yml.github/workflows/docker-release.ymlTesting
Smoke tested locally — all three images start cleanly:
tika-grpc:Server started, listening on 9090tika-server minimal:Started Apache Tika server ... at http://0.0.0.0:9998/